// components/neighbor/neighbor.js
import api from '../../utils/api.js'
let app = getApp();
import { HTTP } from '../../utils/http.js'
let http = new HTTP()
import { config } from '../../utils/config'
Component({
    /**
     * 组件的属性列表
     */
    properties: {

    },

    /**
     * 组件的初始数据
     */
    data: {
        groupRank: [],
        imgUrl: config.imgUrl,
    },
    lifetimes: {
        attached: function() {
            // 在组件实例进入页面节点树时执行
            this.getCityThereOrganization(wx.getStorageSync('city_id'))

        },
        detached: function() {
            // 在组件实例被从页面节点树移除时执行
        },
    },

    methods: {
        //拿到本市金币前三的团
        getCityThereOrganization(city_id) {
            console.log('=====================', city_id)
            http.request({
                url: applicationCache.getCityThereOrganization,
                data: {
                    id: city_id,
                },
                success: (res) => {
                    console.log('拿到本市金币前三的团', res);
                    if (res.code == 200) {
                        let groupRank = res.data
                        this.setData({
                            groupRank
                        })
                    } else if (res.code == 40001) {

                    }
                }
            });
        }

        //排序123 
    }
})